import request from '@/utils/request'

// 查询道具列表
export function listNotice(query) {
  return request({
    url: '/system/gm/list',
    method: 'get',
    params: query
  })
}

// 查询道具详细
export function getNotice(noticeId) {
  return request({
    url: '/system/gm/' + noticeId,
    method: 'get'
  })
}

// 新增道具
export function addNotice(data) {
  return request({
    url: '/system/gm',
    method: 'post',
    data: data
  })
}

// 修改道具
export function updateNotice(data) {
  return request({
    url: '/system/gm',
    method: 'put',
    data: data
  })
}

export function changePayloadStatus(payload_id, status) {
  const data = {
    payload_id,
    status
  }
  return request({
    url: '/system/gm/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除道具
export function delNotice(noticeId) {
  return request({
    url: '/system/gm/' + noticeId,
    method: 'delete'
  })
}
